﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SWDataDB.Models;
using SWDataDB.BLL;
using SWDataDB.DAL;
using System.Data;



public partial class AdminManage_add_addPM : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }



    protected void submit_Click(object sender, EventArgs e)
    {
        PM_TBL pm_info = new PM_TBL();
        PMInfo kc_in = new PMInfo();

        pm_info.O_ZL_FILE_ID = Request.Form["ZL_FILE_ID"];
        pm_info.O_PM_NAME = Request.Form["PM_NAME"];
        pm_info.O_PM_CODE = Request.Form["PM_CODE"];


        pm_info.O_BB_NUM = Request.Form["BB_NUM"].Trim().Length==0?0:int.Parse((Request.Form["BB_NUM"]));
        pm_info.O_YP_NUM = Request.Form["YP_NUM"].Trim().Length == 0 ? 0 : int.Parse((Request.Form["YP_NUM"]));
        pm_info.O_GP_NUM = Request.Form["GP_NUM"].Trim().Length == 0 ? 0 : int.Parse((Request.Form["GP_NUM"]));
        pm_info.O_BOP_NUM = Request.Form["BOP_NUM"].Trim().Length == 0 ? 0 : int.Parse((Request.Form["BOP_NUM"]));


        pm_info.O_PM_SLON = int.Parse((Request.Form["PM_SLON_D"] + Request.Form["PM_SLON_F"] + Request.Form["PM_SLON_M"]));
        pm_info.O_PM_SLAT = int.Parse((Request.Form["PM_SLAT_D"] + Request.Form["PM_SLAT_F"] + Request.Form["PM_SLAT_M"]));


        pm_info.O_PM_QUALITY = this.PM_QUALITY.InnerText;
        pm_info.O_PM_SUMMARY = this.PM_SUMMARY.InnerText;
        pm_info.O_SCALE = Request.Form["SCALE"];

        pm_info.O_PM_LDES = this.PM_LDES.InnerText;

        pm_info.O_KEY_WORDS = Request.Form["KEY_WORDS"];

        pm_info.O_TEST_PEOPLE = Request.Form["TEST_PEOPLE"];
        pm_info.O_PM_DATE = Request.Form["PM_DATE"];

        if (kc_in.AddPMInfo(pm_info) == 1)
        {
             
            Response.Write("<script language=javascript>alert('更新成功！');location='../Manage/PMManage.aspx'</script>");
            //Response.Redirect("ZLManage.aspx");
        }
        else
        {
            Response.Write("<script language=javascript>alert('更新失败！');location='../Manage/PMManage.aspx'</script>");
        }
    }
}